@extends('web.layouts.app')

@section('title', trans('seo.invest.title'))
@section('keywords', trans('seo.invest.keywords'))
@section('description', trans('seo.invest.description'))

@section('styles')
  <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/base.css')}}">
  <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/index.css')}}">
  <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/products-list.css')}}">
<style>
.rush-status{background-color:#fb7230;}
.full-status{background-color:#fdb897;}
.payment-status{background-color:#6eba6f;}
.finish-status{background-color:#b1b1b1;}
.late-status{background-color:#f75e5c;}
.fail-status{background-color:#cbcbcb;}
</style>
@endsection
@section('content')
<div class="products-wrap mt20">
	<div class="products-menu wrap">
		<h2>理财产品</h2>
	</div>
	<div class="products-selector-wrap">
		<div class="products-selector wrap">
			<ul>
				<li>
					<span class="item-type">项目收益：</span>
					<a class="item-val {{!isset($find['profit']) || $find['profit']=='all'?'active':''}}" href="/projects?profit=all">全部</a>
					<a class="item-val {{ isset($find['profit']) && $find['profit']=='min-9'?'active':''}}" href="/projects?profit=min-9">9%以下</a>
					<a class="item-val {{ isset($find['profit']) && $find['profit']=='9-11'?'active':''}}" href="/projects?profit=9-11">9%-11%</a>
					<a class="item-val {{ isset($find['profit']) && $find['profit']=='11-13'?'active':''}}" href="/projects?profit=11-13">11%-13%</a>
					<a class="item-val {{ isset($find['profit']) && $find['profit']=='13-max'?'active':''}}" href="/projects?profit=13-max">13%以上</a>
				</li>
				<li>
					<span class="item-type">项目期限：</span>
					<a class="item-val {{!isset($find['time']) || $find['time']=='all'?'active':''}}" href="/projects?time=all">全部</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='0-1'?'active':''}}" href="/projects?time=0-1">1个月内</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='1-3'?'active':''}}" href="/projects?time=1-3">1-3个月</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='3-6'?'active':''}}" href="/projects?time=3-6">3-6个月</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='6-9'?'active':''}}" href="/projects?time=6-9">6-9个月</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='9-12'?'active':''}}" href="/projects?time=9-12">9-12个月</a>
					<a class="item-val {{ isset($find['time']) && $find['time']=='12-max'?'active':''}}" href="/projects?time=12-max">12个月以上</a>
				</li>
				<li>
					<span class="item-type">项目类型：</span>
					<a class="item-val {{!isset($find['type']) || $find['type']=='all'?'active':''}}" href="/projects?type=all">全部</a>
					@foreach($types as $item)
					<a class="item-val {{ isset($find['type']) && $find['type']==$item->id?'active':''}}" href="/projects?type={{$item->id}}">{{$item->name}}</a>
					@endforeach
				</li>
				<li>
					<span class="item-type">项目状态：</span>
					<a class="item-val {{!isset($find['status']) || $find['status']=='all'?'active':''}}" href="/projects?status=all">全部</a>
					@foreach($status as $item)
					<a class="item-val {{ isset($find['status']) && $find['status']==$item->code?'active':''}}" href="/projects?status={{$item->code}}">{{$item->name}}</a>
					@endforeach
				</li>
				<li>
					<span class="item-type">起投金额：</span>
					<a class="item-val {{!isset($find['money']) || $find['money']=='all'?'active':''}}" href="/projects?money=all">全部</a>
					<a class="item-val {{ isset($find['money']) && $find['money']=='min-500'?'active':''}}" href="/projects?money=min-500">500元以下</a>
					<a class="item-val {{ isset($find['money']) && $find['money']=='500-2000'?'active':''}}" href="/projects?money=500-2000">500-2000元</a>
					<a class="item-val {{ isset($find['money']) && $find['money']=='2000-10000'?'active':''}}" href="/projects?money=2000-10000">2000-10000元</a>
					<a class="item-val {{ isset($find['money']) && $find['money']=='10000-max'?'active':''}}" href="/projects?money=10000-max">10000以上</a>
					<form action="/projects">
						<span class="item-other">
							<input class="txt" name="money[]" value="{{isset($find['money']) && is_array($find['money'])?$find['money'][0]:''}}" type="text">元 - 
							<input class="txt" name="money[]" value="{{isset($find['money']) && is_array($find['money'])?$find['money'][1]:''}}" type="text">元
						</span>
						<button type="submit" class="button">筛选</button>
					</form>
				</li>
			</ul>
		</div>
	</div>
</div>
<div class="container mt10 pt10 wrap">
	<div class="project-box">
		<!-- <div class="project-data">
			<ul>
				<li>今日成交额 <em>591,600</em></li>
				<li>为投资人赚取收益 <em>245,591,600</em></li>
				<li class="noborder">累计帮助企业和个人融资 <em>600,591,600</em></li>
			</ul>
		</div> -->
		<div class="project-details">
			<dl style="">
				<dt class="project-type">
					<ul>
						<li class="project-name">项目名称</li>
						<li class="project-profit">预期收益</li>
						<li class="project-term">投资期限</li>
						<li class="project-minimum">起购金额</li>
						<li class="project-speed">投资进度</li>
						<li class="project-state">状态</li>
					</ul>
				</dt>
				@forelse($list as $item)
				<dd class="conten">
					<ul>
						<li class="project-name">
							<div clsss="">
								<p class="title">{{$item->projects_name}}</p>
								<ul class="danbao">
									<li><img src="{{asset('resources/web/uploads/icont-danbao.png')}}" height="18" width="18">{{($item->collateral_type=='collateral_type_1' || $item->collateral_type=='collateral_type_2')?'担保':'信用'}}</li>
									@if($item->is_plan)
									<li><img src="{{asset('resources/web/uploads/icont-beifujin.png')}}" height="18" width="18">风险备付金</li>
									@endif
									@if($item->repayment)
									<li><img src="{{asset('resources/web/uploads/icont-'.$item->repayment.'.png')}}" height="18" width="18">{{$item->repayment()->name}}</li>
									@endif
								</ul>
							</div>
						</li>
						<li class="project-profit">
							<div class="profit">{!! $item->auto_rate !!}</div>
						</li>
						<li class="project-term">
							<div class="term">
							{{$item->finance_time_num}}
							@if($item->finance_time_cate=='d')
								<i>天</i>
							@elseif($item->finance_time_cate=='m')
								<i>个月</i>
							@elseif($item->finance_time_cate=='mm')
								<i>自然月</i>
							@endif
							</div>
						</li>
						<li class="project-minimum">
							<div class="minimum">{{$item->finance_rule_money}}</div>
						</li>
						<li class="project-speed ">
							<div class="speed">
								<div class="jindu">
									<em style="width:{{round($item->financed_money/$item->finance_money*100,2)}}%"></em>
								</div>
								<span>{{round($item->financed_money/$item->finance_money*100,2)}}%</span>
								<p>
									可投金额：{{number_format(($item->finance_money-$item->financed_money)/10000,2)}}万元 / 
									总额：{{number_format($item->finance_money/10000,2)}}万元</p>
								<!-- <p>9天11小时28分00秒</p> -->
							</div>
						</li>
						<li class="project-state">
							<a href="/oneProjects/{{$item->id}}" class="state {{$item->status}}-status">{{$item->status()->name}}</a>
						</li>
					</ul>
				</dd>
				@empty
				<dd>无相关记录</dd>
				@endforelse
			</dl>
		</div>
    {{$links}}
	</div>
	<!-- <div class="full-banner mt20">
		<a href="#"><img src="../public/uploads/fullbanner2.jpg" height="80" width="1200"></a>
	</div> -->
</div>
@endsection
@section('scripts')
<script type="text/javascript">
</script>
@endsection